<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>输出数组的长度</title>
</head>
<body>
<script>
  var arr = [];
  arr = [81, 82, 83, 98, 59];
  for (var i = 0; i < arr.length; i++) {
    alert("第" +(i + 1)+ "位同学分数是：" + arr[i]);
  }
  alert("数组长度为：" + arr.length);
</script>
</body>
</html>